<?php
namespace Home\Controller;
// +----------------------------------------------------------------------
// | OneThink [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013 http://www.onethink.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: 麦当苗儿 <zuojiazi@vip.qq.com> <http://www.zjzit.cn>
// +----------------------------------------------------------------------
/**
 * 前台首页控制器
 * 主要获取首页聚合数据
 */
class IndexController extends HomeController {

	//系统首页
    public function index(){
//视频
$video = D('Document')->getlist(5);
//dump($video);die;
$this->assign('video',$video);
//音乐
$music = D('Document')->getlist(4);
$this->assign('music',$music);

//首页音乐制作
$index_music=D('Document')->lists(72);
$index_arr1=array();
foreach ($index_music as $key => $val) {
       $index_arr1[] = D('Document')->detail($val['id']);
  }
$this->assign("index_arr1",$index_arr1[0]);   


//首页影视制作
$index_video=D('Document')->lists(73);
$index_arr2=array();
foreach ($index_video as $key => $val) {
       $index_arr2[] = D('Document')->detail($val['id']);
  }
$this->assign("index_arr2",$index_arr2[0]); 

//首页關於我們
$index_about=D('Document')->lists(62);
$index_arr3=array();
foreach ($index_about as $key => $val) {
       $index_arr3[] = D('Document')->detail($val['id']);
  }
$this->assign("index_arr3",$index_arr3[0]); 

//音乐介绍
$about_music=D('Document')->lists(68);
$arry1=array();
  foreach ($about_music as $key => $val) {
       $arry1[] = D('Document')->detail($val['id']);
  }
$this->assign("about1",$arry1[0]['a_content']);   

//个人MV介绍
$about_music1=D('Document')->lists(70);
$arry2=array();
  foreach ($about_music1 as $key => $val) {
       $arry2[] = D('Document')->detail($val['id']);
  }
$this->assign("about2",$arry2[0]['a_content']); 

//音乐介绍
$about_music2=D('Document')->lists(69);
$arry3=array();
  foreach ($about_music2 as $key => $val) {
       $arry3[] = D('Document')->detail($val['id']);
  }
$this->assign("about3",$arry3[0]['a_content']); 
//图片
$pic = D('Document')->getlist(6);
//dump($pic);die;
$this->assign('pic',$pic);
//关于我们
$about = D('Document')->getlist(8);
//dump($about);die;
$this->assign('about',$about);
//联系我们
$contact = D('Document')->getlist(10);
$this->assign('contact',$contact);
//地图
$map=D('Document')->lists(67);
$arrs=array();
foreach ($map as $key=>$val){
    $arrs[] = D('Document')->detail($val['id']);
}
$this->assign('map',$arrs[0]['cover_id']);
////收费表
$fee = D('Document')->tolist(13);
$this->assign('Fees',$fee);
//评论
$comment = D('Document')->listss(7);
$this->assign('Comment',$comment);
////专辑
$special = D('Document')->tolist(12);
$this->assign('Special',$special);
//合作客户
$client = D('Document')->getlist(6);
$this->assign('Client',$client);
//相册
$document = D('Document')->listss(6);
$category = D('Category')->getChildrenId(49);
$arr = array();
$arr =explode(',',$category) ;
//dump($arr);die;
$this->assign('list',$arr);
$models=D('Document');//logo
                $list=$models->lists(64);
                $arry=array();
                foreach ($list as $key => $val) {
                    $arry[] = $models->detail($val['id']);
                }
   $this->assign('logo',$arry[0]['cover_id']);
$this->assign('Category',$category);
$this->display();
    }

}